package File;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;


public class DoWorkFile {
    public static void main(String[] args){
        File file1=new File("E:\\file\\file11.txt");
        File file2=new File("E:\\file\\file22.txt");
        File file3=new File("E:\\file\\file33.txt");
        File file4=new File("E:\\file\\file44.txt");
        try {
            FileReader fileReader = new FileReader(file1);
            FileReader fileReader1=new FileReader(file2);
            FileReader fileReader2=new FileReader(file3);
            FileWriter fileWriter = new FileWriter(file4);
            int date;
            while ((date = fileReader.read()) != -1) {
                fileWriter.write((char) date);
            }
            fileReader.close();
            while ((date=fileReader1.read())!=-1){
                fileWriter.write((char)date);
            }
            fileReader1.close();
            while((date=fileReader2.read())!=-1){
                fileWriter.write((char)date);
            }
            fileReader2.close();
            fileWriter.close();
           FileReader fileReader3=new FileReader(file4);
            System.out.println("复制成功");
            System.out.println("输出文件内容：");
            while ((date=fileReader3.read())!=-1){
                System.out.print((char)date);
            }
            fileReader3.close();
        }catch ( Exception e){
                throw new RuntimeException(e);
        }
    }
}
